<template>
    <div>
        <el-form ref="caseData" :model="caseData" label-width="150px" :label-position="labelPosition"
                 style="margin-left:5%">
            <el-form-item label="案号 :">
                <span>{{caseData.caseNo}}</span>
            </el-form-item>
            <el-form-item label="案件名称 :">
                <span>{{caseData.name}}</span>
            </el-form-item>
            <el-form-item label="案件类型 :">
                <span>{{caseData.typeName}}</span>
            </el-form-item>
            <el-form-item label="受理法院 :">
                <span>{{caseData.courtName}}</span>
            </el-form-item>
            <el-form-item label="申报期限 :">
                <span>{{caseData.declareLimit}}</span>
            </el-form-item>
            <el-form-item label="开户行 :">
                <span>{{caseData.bankName}}</span>
            </el-form-item>
            <el-form-item label="银行账号 :">
                <span>{{caseData.bankAccount}}</span>
            </el-form-item>
            <el-form-item label="发件箱 :">
                <span>{{caseData.email}}</span>
            </el-form-item>
            <el-form-item label="备注 :">
                <span>{{caseData.note}}</span>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    import util from 'assets/js/util.js'

    export default {
        data() {
            return {
                caseData: {
                    caseNo: '',
                    name: '',
                    typeName: '',
                    courtName: '',
                    declareLimit: '',
                    bankName: '',
                    bankAccount: '',
                    email: '',
                    note: ''
                },
                labelPosition: 'left',
            }
        },
        mounted() {
            //this.caseId = util.getUrlParam(document.location.href, 'caseId');
            //this.creditorId = util.getUrlParam(document.location.href, 'creditorId');

            const _self = this;
            util.ajax({
                url:  '/case/detail',
                success: function (data) {
                    _self.caseData.caseNo = data.data.caseNo;
                    _self.caseData.name = data.data.name;
                    /*_self.caseData.typeName = _self.matchTypeText(data.type);*/
                    _self.caseData.typeName = data.data.typeName;
                    _self.caseData.courtName = data.data.courtName;
                    _self.caseData.declareLimit = util.formatDate(data.data.declareLimit);
                    _self.caseData.bankName = data.data.bankName;
                    _self.caseData.bankAccount = data.data.bankAccount;
                    _self.caseData.email = data.data.email;
                    _self.caseData.note = data.data.note;
                }
            });
        },
        methods: {
            /*matchTypeText: function (type) {
                let typeText = '';
                switch (type) {
                    case 1:
                        typeText = '破产清算';
                        break;
                    case 2:
                        typeText = '破产重整';
                        break;
                    case 3:
                        typeText = '破产和解';
                        break;
                    case 4:
                        typeText = '其他';
                        break;
                    default:
                        break
                }
                return typeText
            },*/
        }
    }
</script>

<style scoped>
    span {
        float: right;
        margin-right: 20%;
    }

    form .el-form-item {
        margin-bottom: 8px;
    }
</style>
